﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrdersAuditing.aspx.cs"
    Inherits="Skyworth.CRM.Web.Orders.OrdersAuditing" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <link href="../themes/css/Messagebox.css" rel="stylesheet" type="text/css" />
    <link href="../themes/default/style.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/core.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/pages.css" rel="stylesheet" type="text/css" />
    <%--[if IE]>
     <link href="../themes/css/ieHack.css" rel="stylesheet" type="text/css" />
    <![endif]--%>

    <script src="../javascripts/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="../javascripts/jquery.autocomplete.js" type="text/javascript"></script>

    <script src="../javascripts/json2.js" type="text/javascript"></script>

    <script src="../javascripts/MessageBox.js" type="text/javascript"></script>

    <style type="text/css">
        .red
        {
            color: Red;
            font-weight: bold;
        }
        table
        {
            border-collapse: collapse;
            border-spacing: 0;
            table-layout: fixed;
            width: 100%;
            border: solid 1px #e7e7e7;
        }
        tr td
        {
            border-bottom: solid 1px #e7e7e7;
            padding: 0px 3px;
        }
        td label
        {
            padding: 2px 2px;
        }
        td.left
        {
            border-right: solid 1px #e7e7e7;
            width: 120px;
            background-color: #EFEFEF;
        }
        td.right
        {
            background: #FFF;
        }
        td.right, td.readOnly
        {
            padding: 5px 3px;
        }
        .content
        {
            overflow: auto;
            border: solid 1px #CCC;
            line-height: 21px;
            background: #FFF;
            padding: 3px;
        }
    </style>

    <script type="text/javascript">
        function SaveCheck() {
          var bh = $("#rbNo:checked");
          var bhStep = $("input[type='radio'][name='b']:checked");
          if (bh && bh.length > 0) {
              
              var hidBHStep = $("#txtRejectStep").val();
              if ((bhStep && bhStep.length <= 0) || hidBHStep <= 0) { alert("请选择要驳回的步骤！"); return false; }
          }
          else {            
            if (bhStep && bhStep.length > 0){return confirm("只有当审核结果为驳回时，选择驳回到哪一步才有意义。即使勾选了相应步骤，流程也不会进入此相应的步骤。");}
          }
        }
        $(document).ready(function() {
            $("#btnClose").click(function() {
                parent.addWindow.close();
            })
            $("#btnSave").click(function() {
                return SaveCheck();
            })
//            $("input[type='radio'][name='a']").change(function() {
//                if ($(this).attr("id") == "rbNo" && $(this).attr("checked")) {
//                    $("#trOrderProcess").fadeIn();
//                }
//                else {
//                    $("#trOrderProcess").fadeOut();
//                }
//            })
            $("input[type='radio'][name='b']").change(function() {
                if ($(this).attr("checked"))
                    $("#txtRejectStep").val($(this).val());
            })
        })
    </script>

</head>
<body style="background-color: White; overflow:visible">
    <form id="form1" runat="server">
    <div>
        <div class="panel">
            <div class="panelHeader">
                <div class="panelHeaderContent">
                    <h1>
                        审核订单</h1>
                </div>
            </div>
            <div class="panelContent">
                <div class="content">
                    <table width="100%" id="Table1">
                        <tr>
                            <td class="left">
                                <label for="txtTaxPrice">
                                    审核结果：</label>
                            </td>
                            <td class="right">
                                <asp:RadioButton ID="rbYes" runat="server" Text="同意" GroupName="a" Checked="true" />
                                <asp:RadioButton ID="rbNo" runat="server" Text="驳回" GroupName="a" />
                                <asp:RadioButton ID="rbReject" runat="server" Text="不同意" GroupName="a" />
                            </td>
                            <td class="left">
                                <label for="txtCashAmount">
                                    审核意见：</label>
                            </td>
                            <td class="right">
                                <asp:TextBox ID="txtNotes" runat="server" TextMode="MultiLine" Height="40px"></asp:TextBox>
                                
                            </td>
                        </tr>
                        <tr  id="trOrderProcess">
                            <td colspan="4" style="background-color: White; padding: 2px;">
                                <div class="tableList">
                                    <table class="list" width="100%">
                                        <thead>
                                            <tr>
                                                <th width="80" valign="middle">
                                                    <span>处理人</span>
                                                </th>
                                                <th width="120" valign="middle">
                                                    <span>处理日期</span>
                                                </th>
                                                <th width="80" valign="middle">
                                                    <span>处理结果</span>
                                                </th>
                                                <th valign="middle">
                                                    <span>处理意见</span>
                                                </th>
                                                <th width="40" valign="middle">
                                                    <span>驳回到</span>
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <asp:Literal ID="OrderProcessBody" runat="server"></asp:Literal>
                                        </tbody>
                                    </table>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" class="readOnly" style="padding-right: 12px; background: url('../themes/default/images/grid/grid.png') repeat scroll 0 0">
                                <a title="关闭当前窗体" href="javascript:void(0)" class="button" style="float: left" id="btnClose">
                                    <span>关闭</span></a>
                                <div class="buttonActive" style="float: right; margin-right: 5px;">
                                    <div class="buttonContent">
                                        <asp:Button ID="btnSave" runat="server" Text="确定" ToolTip="保存审核结果信息" 
                                            CssClass="serverButton" onclick="btnSave_Click" />
                                    </div>
                                </div>
                                <div style="clear: both; float: none; display: none;">
                                <asp:HiddenField ID="txtRejectStep" runat="server" />
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="panelFooter">
                <div class="panelFooterContent">
                </div>
            </div>
        </div>
        <br />
        <div class="panel">
            <div class="panelHeader">
                <div class="panelHeaderContent">
                    <h1>
                        订单信息</h1>
                </div>
            </div>
            <div class="panelContent">
                <div class="content">
                    <table width="100%" id="layout">
                        <tr>
                            <td class="left">
                                <label for="txtOrderCode">
                                    订单编号：</label>
                            </td>
                            <td class="right">
                                <asp:Label ID="txtOrderCode" runat="server" Text=""></asp:Label>
                            </td>
                            <td class="left">
                                <label for="txtTotalMoney">
                                    订单客户总金额：</label>
                            </td>
                            <td class="right">
                                <asp:Label ID="txtTotalMoney" runat="server" Text="0.00" CssClass="red"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="left">
                                <label for="txtPrice">
                                    订单不含税价格：</label>
                            </td>
                            <td class="right">
                                <asp:Label ID="txtPrice" runat="server" Text="0.00"></asp:Label>
                            </td>
                            <td class="left">
                                <label for="txtCredit">
                                    订单客户信用额度：</label>
                            </td>
                            <td class="right">
                                <asp:Label ID="txtCredit" runat="server" Text="0.00" CssClass="red"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="left">
                                <label for="txtTaxPrice">
                                    订单含税价格：</label>
                            </td>
                            <td class="right">
                                <asp:Label ID="txtTaxPrice" runat="server" Text="0.00"></asp:Label>
                            </td>
                            <td class="left">
                                <label for="txtCashAmount">
                                    订单客户现款金额：</label>
                            </td>
                            <td class="right">
                                <asp:Label ID="txtCashAmount" runat="server" Text="0.00" CssClass="red"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" style="background-color: White; padding: 2px">
                                <div class="tableList">
                                    <table class="list" width="100%">
                                        <thead>
                                            <tr>
                                                <th width="150" valign="middle">
                                                    <span>产品名称</span>
                                                </th>
                                                <th valign="middle">
                                                    <span>订购数量</span>
                                                </th>
                                                <th valign="middle">
                                                    <span>单位</span>
                                                </th>
                                                <th valign="middle">
                                                    <span>不含税金额</span>
                                                </th>
                                                <th valign="middle">
                                                    <span>含税金额</span>
                                                </th>
                                                <th valign="middle">
                                                    <span>当前库存</span>
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <asp:Literal ID="orderDetailBody" runat="server"></asp:Literal>
                                        </tbody>
                                    </table>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="panelFooter">
                <div class="panelFooterContent">
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
